package org.devocean.groupbuying.service.impl;

import org.devocean.groupbuying.dao.MenuLocalizationDAO;
import org.devocean.groupbuying.domain.MenuLocalization;
import org.devocean.groupbuying.service.MenuLocalizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class MenuLocalizationServiceImpl implements MenuLocalizationService {

	@Autowired
	private MenuLocalizationDAO menuLocalizationDAO;
	
	@Transactional
	public MenuLocalization saveOrUpdateMenuLocalization(MenuLocalization menuLocalization) {
		if(menuLocalization.getMenuLocalizationID()== null)
			return menuLocalizationDAO.saveMenuLocalization(menuLocalization);
		else
			return menuLocalizationDAO.updateMenuLocalization(menuLocalization);
	}


	@Transactional(readOnly = true)
	public MenuLocalization findMenuById(Integer menuId) {
		return menuLocalizationDAO.findMenuById(menuId);
	}



	public void deleteMenuLocalization(Integer id) {
		menuLocalizationDAO.deleteMenuLocalization(id);
	}


	public MenuLocalization getMenuLocalizationById(Integer id) {
		return menuLocalizationDAO.findMenuLocalizationById(id);
	}

}
